<!-- 审核列表 -->
<template>
  <div class="disFlx">
    <TableMenu
      class="br-10"
      title="会员审核"
      :selectKey="menuKey"
      :menuList="menuList"
      @change="key => (menuKey = key)"
    />
    <div style="width: calc(100% - 160px)">
      <Join v-if="menuKey === 'join'" v-has="'member:approval:join'" />
      <Source v-if="menuKey === 'source'" v-has="'member:approval:source'" />
      <Renew v-if="menuKey === 'renew'" v-has="'member:approval:renew'" />
    </div>
  </div>
</template>

<script>
import TableMenu from '@/components/TableMenu'
import Join from './components/join'
import Source from './components/source'
import Renew from './components/renew'
import { checkPermission } from '@/utils/authority'

export default {
  components: {
    TableMenu,
    Join,
    Source,
    Renew
  },
  data() {
    return {
      menuList: [],
      menuKey: ''
    }
  },
  methods: {},
  created() {
    if (checkPermission('member:approval:join')) {
      this.menuList.push({
        name: '会员认证审核',
        key: 'join'
      })
    }
    if (checkPermission('member:approval:source')) {
      this.menuList.push({
        name: '资料变更审核',
        key: 'source'
      })
    }
    if (checkPermission('member:approval:renew')) {
      this.menuList.push({
        name: '续费凭证审核',
        key: 'renew'
      })
    }
    let menuKey = this.$route.query.menuKey
    this.menuKey = menuKey || this.menuList[0].key
  },
  mounted() {}
}
</script>
<style scoped></style>
